
package rs_GUI;

import java.awt.Color;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import pojos.Album;
import javax.swing.JOptionPane;
import pojos.Song;

/**
 *
 * @author KATERINA
 */
public class AlbumManagement extends javax.swing.JPanel {

    private RadioStationParentFrame frame;
    private EntityManager em;
    private Album album2 = new Album();
    private int x;  //Το χρεισημοποιούμε για να ξέρουμε αν έχουμε έρθει από το ArtistAlbum_MainPanel (όταν x=1)
                    //ή από το GroupAlbum_MainPanel (όταν x=2)
    private boolean cancelSave; //Είναι true όταν έχουμε έρθει με το κουμπί μεταβολή, ενω
                                //το θέτουμε false όταν όταν έχουμε έρθει με το κουμπί εισαγωγή
    private boolean enable = false;
    private List<Song> ar = new ArrayList();
    private boolean ns = false; //Το χρεισημοποιούμε για να ξέρουμε αν έχουμε προσθέσει νέο τραγούδι
    private Song song;
    private int row;
    private Song song2;
    private Song s1;
    
    JMenuBar menu = new JMenuBar();
    JMenu  jMenu1 = new JMenu("Μενού"); 
    
    public AlbumManagement(RadioStationParentFrame frame, EntityManager em, Album album2, int x, boolean cancelSave) {
        this.frame = frame;
        this.em = em;
        this.album2 = album2;
        this.x = x;
        this.cancelSave = cancelSave;
        initComponents();
        
        //Αν προερχόμαστε από τη φόρμα "ΠΙΝΑΚΑΣ ΑΛΜΟΥΜ ΚΑΛΛΙΤΕΧΝΩΝ"
        if(x == 1){
            //Απενεργοποιείται η επεξεργασία του group
            groupComboBox.setEnabled(false);
            groupComboBox.setBackground(Color.lightGray);
            groupPanel.setBackground(Color.lightGray);
            removeGroupButton.setVisible(false);
            enableCheckBox1.setVisible(false);
        }
        //Αν προερχόμαστε από τη φόρμα "ΠΙΝΑΚΑΣ ΑΛΜΠΟΥΜ ΣΥΓΚΡΟΤΗΜΑΤΩΝ"
        else{
            //Απενεργοποιείται η επεξεργασία του καλλιτέχνη
            artistComboBox.setEnabled(false);
            artistComboBox.setBackground(Color.lightGray);
            artistPanel.setBackground(Color.lightGray);
            removeArtistButton.setVisible(false);
            enableCheckBox2.setVisible(false);
        }
        
        //Θέτουμε τον τύπο του άλμουμ
        if (album2.getType().equals("cs")) { 
            typeComboBox.setSelectedItem("cd single");
        } else if (album2.getType().equals("ep")) { 
            typeComboBox.setSelectedItem("extended play");
        } else { 
            typeComboBox.setSelectedItem("long play");
            }
        
        if (album2.getType().equals("lp")){
            diskNrSpinner.setEnabled(true);
        }
        else{
            diskNrSpinner.setEnabled(false);
        }
        
        //Φιλτράρισμα της λίστας τραγουδιών
        getAlbumSongs();
        
        //Ταξινόμηση της songList
        sortSongList();
        
        JMenuItem saveAlbumItem = new JMenuItem("Αποθήκευση");
        saveAlbumItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveAlbumItemActionPerformed(evt);
            }
        });
        jMenu1.add(saveAlbumItem);
              
        JMenuItem cancelItem = new JMenuItem("Ακύρωση");
        cancelItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelItemActionPerformed(evt);
            }
        });
        jMenu1.add(cancelItem);
               
        menu.add(jMenu1);
        frame.setJMenuBar(menu);
    }
    
    private void saveAlbumItemActionPerformed(java.awt.event.ActionEvent evt) {                                           
        this.saveButtonActionPerformed(evt);
    }      
     
    private void cancelItemActionPerformed(java.awt.event.ActionEvent evt) {                                           
        this.cancelButtonActionPerformed(evt);
    } 
    
    //Φιλτράρισμα της λίστας τραγουδιών ώστε να δείχνει μόνο τα τραγούδια 
    //που περιέχονται στο album2
    private void getAlbumSongs(){
        songList.clear();
        for(Song s : album2.getSongList()){
           songList.add(s);
        }
    }
    
    //Ταξινόμηση της songList
    private void sortSongList(){
        Collections.sort(songList, new Comparator<Song>() {
            @Override 
            public int compare(Song s1, Song s2) {
                return s1.getTracknr() - s2.getTracknr();
            }
        });
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        musicproductioncompanyQuery = java.beans.Beans.isDesignTime() ? null : em.createQuery("SELECT m FROM Musicproductioncompany m");
        musicproductioncompanyList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : musicproductioncompanyQuery.getResultList();
        album1 = album2;
        artistQuery = java.beans.Beans.isDesignTime() ? null : em.createQuery("SELECT a FROM Artist a");
        artistList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : artistQuery.getResultList();
        musicgroupQuery = java.beans.Beans.isDesignTime() ? null : em.createQuery("SELECT m FROM Musicgroup m");
        musicgroupList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : musicgroupQuery.getResultList();
        albumQuery = java.beans.Beans.isDesignTime() ? null : em.createQuery("SELECT al FROM Album al");
        albumList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : albumQuery.getResultList();
        songQuery = java.beans.Beans.isDesignTime() ? null : em.createQuery("SELECT s  FROM Song s");
        songList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList(songQuery.getResultList());
        mainLabel = new javax.swing.JLabel();
        songListPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        songTable = new javax.swing.JTable();
        newButton = new javax.swing.JButton();
        deleteButton = new javax.swing.JButton();
        albumDataPanel = new javax.swing.JPanel();
        productionCompanyComboBox = new javax.swing.JComboBox();
        productionCompanyLabel = new javax.swing.JLabel();
        releaseDateLabel = new javax.swing.JLabel();
        titleTextField = new javax.swing.JTextField();
        typeLabel = new javax.swing.JLabel();
        typeComboBox = new javax.swing.JComboBox();
        releaseDateDateChooser = new com.toedter.calendar.JDateChooser();
        titleLabel = new javax.swing.JLabel();
        diskNrLabel = new javax.swing.JLabel();
        diskNrSpinner = new javax.swing.JSpinner();
        performersPanel = new javax.swing.JPanel();
        groupPanel = new javax.swing.JPanel();
        groupLabel = new javax.swing.JLabel();
        groupComboBox = new javax.swing.JComboBox();
        removeGroupButton = new javax.swing.JButton();
        enableCheckBox2 = new javax.swing.JCheckBox();
        artistPanel = new javax.swing.JPanel();
        artistLabel = new javax.swing.JLabel();
        artistComboBox = new javax.swing.JComboBox();
        removeArtistButton = new javax.swing.JButton();
        enableCheckBox1 = new javax.swing.JCheckBox();
        cancelButton = new javax.swing.JButton();
        saveButton = new javax.swing.JButton();

        setToolTipText("Φόρμα Διαχείρισης Άλμπουμ");
        setPreferredSize(new java.awt.Dimension(610, 445));

        mainLabel.setText("ΦΟΡΜΑ ΔΙΑΧΕΙΡΙΣΗΣ ΑΛΜΠΟΥΜ");

        songListPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Λίστα Τραγουδιών"));

        songTable.setFont(new java.awt.Font("Comic Sans MS", 1, 13)); // NOI18N
        songTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        songTable.getTableHeader().setReorderingAllowed(false);

        org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, songList, songTable);
        org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${tracknr}"));
        columnBinding.setColumnName("α/α");
        columnBinding.setColumnClass(Integer.class);
        columnBinding.setEditable(false);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${title}"));
        columnBinding.setColumnName("Τίτλος");
        columnBinding.setColumnClass(String.class);
        columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${duration}"));
        columnBinding.setColumnName("Διάρκεια (sec)");
        columnBinding.setColumnClass(Integer.class);
        bindingGroup.addBinding(jTableBinding);
        jTableBinding.bind();
        jScrollPane1.setViewportView(songTable);
        if (songTable.getColumnModel().getColumnCount() > 0) {
            songTable.getColumnModel().getColumn(0).setPreferredWidth(0);
            songTable.getColumnModel().getColumn(2).setPreferredWidth(0);
        }

        newButton.setBackground(new java.awt.Color(255, 255, 255));
        newButton.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        newButton.setForeground(new java.awt.Color(0, 51, 0));
        newButton.setText("+");
        newButton.setToolTipText("Προσθήκη τραγουδιού");
        newButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        newButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                newButtonActionPerformed(evt);
            }
        });

        deleteButton.setBackground(new java.awt.Color(255, 255, 255));
        deleteButton.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        deleteButton.setForeground(new java.awt.Color(204, 0, 0));
        deleteButton.setText("-");
        deleteButton.setToolTipText("Αφαίρεση Τραγουδιού");
        deleteButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        deleteButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout songListPanelLayout = new javax.swing.GroupLayout(songListPanel);
        songListPanel.setLayout(songListPanelLayout);
        songListPanelLayout.setHorizontalGroup(
            songListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(songListPanelLayout.createSequentialGroup()
                .addGap(1, 1, 1)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 500, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(songListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(newButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        songListPanelLayout.setVerticalGroup(
            songListPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(songListPanelLayout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(songListPanelLayout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(newButton, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(deleteButton, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        newButton.getAccessibleContext().setAccessibleName("");
        newButton.getAccessibleContext().setAccessibleDescription("");

        albumDataPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, musicproductioncompanyList, productionCompanyComboBox);
        bindingGroup.addBinding(jComboBoxBinding);
        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, album1, org.jdesktop.beansbinding.ELProperty.create("${musicproductioncompanyid}"), productionCompanyComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
        bindingGroup.addBinding(binding);

        productionCompanyComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productionCompanyComboBoxActionPerformed(evt);
            }
        });

        productionCompanyLabel.setText("Εταιρεία Παραγωγής *");

        releaseDateLabel.setText("Ημερομηνία Κυκλοφορίας");

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, album1, org.jdesktop.beansbinding.ELProperty.create("${title}"), titleTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        typeLabel.setText("Τύπος Άλμπουμ *");

        typeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "cd single", "extended play", "long play" }));
        typeComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                typeComboBoxActionPerformed(evt);
            }
        });

        releaseDateDateChooser.setDate(album1.getReleasedate());

        titleLabel.setText("Τίτλος *");

        diskNrLabel.setText("Αριθμός Άλμπουμ *");

        diskNrSpinner.setModel(new javax.swing.SpinnerNumberModel(Integer.valueOf(1), Integer.valueOf(1), null, Integer.valueOf(1)));

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, album1, org.jdesktop.beansbinding.ELProperty.create("${disknumber}"), diskNrSpinner, org.jdesktop.beansbinding.BeanProperty.create("value"));
        bindingGroup.addBinding(binding);

        javax.swing.GroupLayout albumDataPanelLayout = new javax.swing.GroupLayout(albumDataPanel);
        albumDataPanel.setLayout(albumDataPanelLayout);
        albumDataPanelLayout.setHorizontalGroup(
            albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(albumDataPanelLayout.createSequentialGroup()
                .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(albumDataPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(titleLabel)
                            .addComponent(typeLabel)
                            .addComponent(productionCompanyLabel)
                            .addComponent(releaseDateLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(titleTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(typeComboBox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(productionCompanyComboBox, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 168, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(releaseDateDateChooser, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(albumDataPanelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(diskNrLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(diskNrSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        albumDataPanelLayout.setVerticalGroup(
            albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(albumDataPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(titleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(titleLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(typeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(typeLabel))
                .addGap(18, 18, 18)
                .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(productionCompanyComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(productionCompanyLabel))
                .addGap(18, 18, 18)
                .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(diskNrLabel)
                    .addComponent(diskNrSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(albumDataPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(releaseDateLabel)
                    .addComponent(releaseDateDateChooser, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(14, Short.MAX_VALUE))
        );

        performersPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)), "Ερμηνευτές *"));

        groupPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        groupLabel.setText("Group");

        groupComboBox.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N

        jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, musicgroupList, groupComboBox);
        bindingGroup.addBinding(jComboBoxBinding);
        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, album1, org.jdesktop.beansbinding.ELProperty.create("${musicgroupid}"), groupComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
        bindingGroup.addBinding(binding);

        removeGroupButton.setText("Αφαίρεση του Group");
        removeGroupButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeGroupButtonActionPerformed(evt);
            }
        });

        enableCheckBox2.setToolTipText("Ενεργοποίηση/Απενεργοπίηση επεξεργασίας Group");
        enableCheckBox2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enableCheckBox2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout groupPanelLayout = new javax.swing.GroupLayout(groupPanel);
        groupPanel.setLayout(groupPanelLayout);
        groupPanelLayout.setHorizontalGroup(
            groupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(groupPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(groupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(groupComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(groupPanelLayout.createSequentialGroup()
                        .addComponent(groupLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 98, Short.MAX_VALUE)
                        .addComponent(enableCheckBox2))
                    .addComponent(removeGroupButton, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        groupPanelLayout.setVerticalGroup(
            groupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(groupPanelLayout.createSequentialGroup()
                .addGroup(groupPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(groupLabel)
                    .addComponent(enableCheckBox2))
                .addGap(5, 5, 5)
                .addComponent(removeGroupButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(groupComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        artistPanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        artistLabel.setText("Καλλιτέχνης");

        artistComboBox.setFont(new java.awt.Font("Tahoma", 1, 13)); // NOI18N

        jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artistList, artistComboBox);
        bindingGroup.addBinding(jComboBoxBinding);
        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, album1, org.jdesktop.beansbinding.ELProperty.create("${artistid}"), artistComboBox, org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
        binding.setSourceNullValue(null);
        bindingGroup.addBinding(binding);

        artistComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                artistComboBoxActionPerformed(evt);
            }
        });

        removeArtistButton.setText("Αφαίρεση Καλλιτέχνη");
        removeArtistButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeArtistButtonActionPerformed(evt);
            }
        });

        enableCheckBox1.setToolTipText("Ενεργοποίηση/Απενεργοπίηση επεξεργασίας καλιτέχνη");
        enableCheckBox1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        enableCheckBox1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                enableCheckBox1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout artistPanelLayout = new javax.swing.GroupLayout(artistPanel);
        artistPanel.setLayout(artistPanelLayout);
        artistPanelLayout.setHorizontalGroup(
            artistPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(artistPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(artistPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(artistComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(removeArtistButton)
                    .addGroup(artistPanelLayout.createSequentialGroup()
                        .addComponent(artistLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(enableCheckBox1)))
                .addContainerGap())
        );
        artistPanelLayout.setVerticalGroup(
            artistPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(artistPanelLayout.createSequentialGroup()
                .addGroup(artistPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(enableCheckBox1)
                    .addComponent(artistLabel))
                .addGap(3, 3, 3)
                .addComponent(removeArtistButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(artistComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout performersPanelLayout = new javax.swing.GroupLayout(performersPanel);
        performersPanel.setLayout(performersPanelLayout);
        performersPanelLayout.setHorizontalGroup(
            performersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(performersPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(performersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(groupPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(artistPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        performersPanelLayout.setVerticalGroup(
            performersPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(performersPanelLayout.createSequentialGroup()
                .addComponent(artistPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(groupPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        cancelButton.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        cancelButton.setForeground(new java.awt.Color(255, 102, 0));
        cancelButton.setText("ΑΚΥΡΩΣΗ");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        saveButton.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        saveButton.setText("ΑΠΟΘΗΚΕΥΣΗ");
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(254, 254, 254)
                        .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(26, 26, 26)
                        .addComponent(saveButton)
                        .addContainerGap(61, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGap(17, 17, 17)
                                        .addComponent(mainLabel))
                                    .addComponent(albumDataPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(performersPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(songListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(mainLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(albumDataPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(performersPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(songListPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(saveButton)
                    .addComponent(cancelButton))
                .addContainerGap())
        );

        bindingGroup.bind();
    }// </editor-fold>//GEN-END:initComponents

    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        // Μήνυμα επιβεβαίωσης της αποθήκευσης
        Object[] options = {"Ναι","Όχι"};
        Integer choice = JOptionPane.showOptionDialog(this,
            "Θέλετε να αποθηκεύσετε τις αλλαγές;",
            "Επιβεβαίωση αλλαγών",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[0]);
        
        //Αν επιλεγεί το "Ναι"
        if (choice == JOptionPane.YES_OPTION){
            
            //Έλεγχος ότι δεν είναι κενά τα υποχρεωτικά πεδία 
            if (album2.getTitle().equals("")) { 
                JOptionPane.showMessageDialog(this, "Τα πεδία με αστερίσκο (*)"+
                    "\nείναι υποχρεωτικά."+
                    "\nΔεν γίνεται να μείνουν κενά", "ERROR",
                JOptionPane.WARNING_MESSAGE);
                return;
                } 
            
            
            //Έλεγχος για το αν υπάρχει ήδη άλμουμ με αυτό τον τίτλο στη ΒΔ
            for (Album alb : albumList) {
                if (alb != album2 && alb.getTitle().equals(album2.getTitle())) { 
                    JOptionPane.showMessageDialog(this, 
                        "Υπάρχει άλμπουμ με αυτό τον τίτλο.", 
                        "Σφάλμα",
                    JOptionPane.WARNING_MESSAGE);
                    return;   
                }   
            }
            
            //Έλεγχος για το ότι υπάρχει τουλάχιστον ένας ερμηνευτής (καλλιτέχνης ή συγκρότημα)
            if ((album2.getArtistid() == null) &&(album2.getMusicgroupid() == null)){
                JOptionPane.showMessageDialog(this, 
                        "Το άλμπουμ δεν έχει ερμηνευτή.", 
                        "Σφάλμα",
                    JOptionPane.WARNING_MESSAGE);
                    return;   
            }
            
            //Έλεγχος για το αν υπάρχουν τραγούδια με τον ίδιο τίτλο στο album2
            for(int i = 0; i < songList.size(); i++){
                for(int j = i+1; j < songList.size(); j++){
                    if(songList.get(i).getTitle().equals(songList.get(j).getTitle())){
                        JOptionPane.showMessageDialog(this, 
                        "Υπάρχουν τραγούδια με τον ίδιο τίτλο στο άλμπουμ.", 
                        "Σφάλμα",
                        JOptionPane.WARNING_MESSAGE);
                        return; 
                    }
                } 
            }
            
            //Έλεγχος για το ότι το άλμουμ διαθέτει τουλάχιστον ένα τραγούδι
            if(songList.isEmpty()){
                JOptionPane.showMessageDialog(this, 
                    "Το άλμπουμ δεν περιέχει κανένα τραγούδι.", 
                    "Σφάλμα",
                    JOptionPane.WARNING_MESSAGE);
                return; 
            }
            
            //Έλεγχος για το αν υπάρχουν τραγούδια χωρίς τίτλο στο album2
            for(int i = 0; i < songList.size(); i++){
                if(songList.get(i).getTitle().equals("")){
                    JOptionPane.showMessageDialog(this, 
                    "To "+(i+1)+"o τραγούδι δεν έχει τίτλο.", 
                    "Σφάλμα",
                    JOptionPane.WARNING_MESSAGE);
                    return; 
                }
            }
            
            //Έλεγχος ότι τα τραγούδια έχουν το καθένα διάρκεια τουλάχιστον 10 δευτερόλεπτα.
            for(int i = 0; i < songList.size(); i++){
                if(songList.get(i).getDuration()<10){
                    JOptionPane.showMessageDialog(this, 
                    "To "+(i+1)+"o τραγούδι έχει διάρκεια"
                    +"\nμικρότερη των 10 δευτερολέπτων.", 
                    "Σφάλμα",
                    JOptionPane.WARNING_MESSAGE);
                    return; 
                }
            }
            
            try {
                //Νέα δοσοληψία
                if (!em.getTransaction().isActive()) {
                    em.getTransaction().begin();
                }
                
                // Διαχείριση της ημερομηνίας κυκλοφορίας του άλμουμ
                Date releaseDate = releaseDateDateChooser.getDate();
                album2.setReleasedate(releaseDate);
                
                // Διαχείριση του τύπου του άλμουμ
                String type = (String) typeComboBox.getSelectedItem();
                if (type.equals("cd single")) { 
                    album2.setType("cs");
                } else if (type.equals("extended play")) { 
                    album2.setType("ep");
                } else { 
                    album2.setType("lp");
                }
                
                //Ανανέωση των τραγουδιών του άλμπουμ
                album1.getSongList().clear();
                album1.getSongList().addAll(songList);
                
                cancelSave = false;
                
                em.getTransaction().commit();
            }catch (Exception e) {
                    e.printStackTrace();
                    JOptionPane.showMessageDialog(null, "Σφάλμα βάσης...");
                }
            if(x == 1){
                frame.addPanelInMain(new ArtistAlbum_MainPanel(frame, em));
            }else{
                frame.addPanelInMain(new GroupAlbum_MainPanel(frame, em));}
            
        }
    }//GEN-LAST:event_saveButtonActionPerformed

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        //Αν έχω έρθει από την ArtistAlbum_MainPanel
        if(x == 1){
            //Ακύρωση μετά από μεταβολή
            if (cancelSave){
                em.refresh(album2);
                cancelSave = false;
                frame.addPanelInMain(new ArtistAlbum_MainPanel(frame, em));
             }
            //Μετά από εισαγωγή
            else {
                //Αναίρεση των αλλαγών που έγιναν στο album2
                album2.setTitle("");
                em.remove(album2);
                cancelSave = false;
                em.getTransaction().commit();
                frame.addPanelInMain(new ArtistAlbum_MainPanel(frame, em));
            }
        }
        //Αν έχω έρθει από την GroupAlbum_MainPanel
        else{
            //Ακύρωση μετά από μεταβολή
            if (cancelSave){
                em.refresh(album2);
                cancelSave = false;
                frame.addPanelInMain(new GroupAlbum_MainPanel(frame, em));
            }
            //Μετά από εισαγωγή
            else {
                //Αναίρεση των αλλαγών που έγιναν στο album2
                album2.setTitle("");
                em.remove(album2);
                cancelSave = false;
                em.getTransaction().commit();
                frame.addPanelInMain(new GroupAlbum_MainPanel(frame, em));
            }
        }
        
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void removeArtistButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeArtistButtonActionPerformed
        album1.setArtistid(null);
        artistComboBox.setSelectedIndex(-1);
    }//GEN-LAST:event_removeArtistButtonActionPerformed

    private void removeGroupButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeGroupButtonActionPerformed
        album1.setMusicgroupid(null);
        groupComboBox.setSelectedIndex(-1);
    }//GEN-LAST:event_removeGroupButtonActionPerformed

    private void typeComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_typeComboBoxActionPerformed
        if(!typeComboBox.getSelectedItem().equals("long play")) {
           diskNrSpinner.setEnabled(false);
           diskNrSpinner.setValue(1);
        } else {
            diskNrSpinner.setEnabled(true);
        }
    }//GEN-LAST:event_typeComboBoxActionPerformed

    private void productionCompanyComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productionCompanyComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_productionCompanyComboBoxActionPerformed

    private void enableCheckBox1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enableCheckBox1ActionPerformed
        if(!enable){
            artistComboBox.setEnabled(true);
            artistComboBox.setBackground(Color.WHITE);
            artistPanel.setBackground(Color.WHITE);
            removeArtistButton.setVisible(true);
            enable = true;
        }
        else{
            artistComboBox.setEnabled(false);
            artistComboBox.setBackground(Color.lightGray);
            artistPanel.setBackground(Color.lightGray);
            removeArtistButton.setVisible(false);
            enable = false;
        }
    }//GEN-LAST:event_enableCheckBox1ActionPerformed

    private void enableCheckBox2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_enableCheckBox2ActionPerformed
        if(!enable){
            groupComboBox.setEnabled(true);
            groupComboBox.setBackground(Color.WHITE);
            groupPanel.setBackground(Color.WHITE);
            removeGroupButton.setVisible(true);
            enable = true;
        }
        else{
            groupComboBox.setEnabled(false);
            groupComboBox.setBackground(Color.lightGray);
            groupPanel.setBackground(Color.lightGray);
            removeGroupButton.setVisible(false);
            enable = false;
        }    
    }//GEN-LAST:event_enableCheckBox2ActionPerformed

    private void newButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newButtonActionPerformed
        //Δημιουργία νέου τραγουδιού
        song = new Song(null);
        song.setTitle("");
        song.setDuration(0);
        song.setTracknr(songList.size()+1);
        song.setAlbumid(album2);
        
        //Προσθήκη του τραγουδιού στη Λίστα (εμφάνιση στον πίνακα) 
        songList.add(song);
        
        //Προσθήκη του τραγουδιού στη λίστα τραγουδιών του album2
        album2.getSongList().add(song);
        
        //Προσθήκη του τραγουδιού στη ΒΔ   
        em.persist(song);
        
             
    }//GEN-LAST:event_newButtonActionPerformed

    private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
        // Βάζουμε στη μεταβλητή row τη γραμμή που επιλέξαμε
        row = songTable.getSelectedRow();
        
        // Αν δεν έχουμε επιλέξει κάτι τότε βγάλε μήνυμα λάθους
        if (row == -1) {
            JOptionPane.showMessageDialog(this, "Επιλέξτε ένα τραγούδι.", 
                                           "ERROR",
                                           JOptionPane.WARNING_MESSAGE);
        }else{
            // Μήνυμα επιβεβαίωσης της διαγραφής
            Object[] options = {"Ναι","Όχι"};
            Integer choice = JOptionPane.showOptionDialog(this,
            "Διαγραφή επιλεγμένου τραγουδιού;",
            "Επιβεβαίωση διαγραφής",
            JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE,
            null,
            options,
            options[0]);
            
            if (choice == JOptionPane.YES_OPTION){
                deleteButton.setEnabled(false);
                newButton.setEnabled(false);
                //Βάλε στο s1 το τραγούδι
                s1 = songList.get(row);
                
                //Διαγράφουμε το τραγούδι από τη λίστα songList
                songList.remove(s1);
                //Αφαιρούμε το τραγούδι από τη λίστα τραγουδιών του album2
                album2.getSongList().remove(s1);
                //Ανακατάταξη της σειράς των τραγουδιών.
                for (int i = 0; i < songList.size(); i++) { 
                songList.get(i).setTracknr(i+1);
                }
                //Αφαιρούμε το τραγούδι από τη βάση
                em.remove(s1);
               
                deleteButton.setEnabled(true);
                newButton.setEnabled(true);
            }
        }
    }//GEN-LAST:event_deleteButtonActionPerformed

    private void artistComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_artistComboBoxActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_artistComboBoxActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private pojos.Album album1;
    private javax.swing.JPanel albumDataPanel;
    private java.util.List<pojos.Album> albumList;
    private javax.persistence.Query albumQuery;
    private javax.swing.JComboBox artistComboBox;
    private javax.swing.JLabel artistLabel;
    private java.util.List<pojos.Artist> artistList;
    private javax.swing.JPanel artistPanel;
    private javax.persistence.Query artistQuery;
    private javax.swing.JButton cancelButton;
    private javax.swing.JButton deleteButton;
    private javax.swing.JLabel diskNrLabel;
    private javax.swing.JSpinner diskNrSpinner;
    private javax.swing.JCheckBox enableCheckBox1;
    private javax.swing.JCheckBox enableCheckBox2;
    private javax.swing.JComboBox groupComboBox;
    private javax.swing.JLabel groupLabel;
    private javax.swing.JPanel groupPanel;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JLabel mainLabel;
    private java.util.List<pojos.Musicgroup> musicgroupList;
    private javax.persistence.Query musicgroupQuery;
    private java.util.List<pojos.Musicproductioncompany> musicproductioncompanyList;
    private javax.persistence.Query musicproductioncompanyQuery;
    private javax.swing.JButton newButton;
    private javax.swing.JPanel performersPanel;
    private javax.swing.JComboBox productionCompanyComboBox;
    private javax.swing.JLabel productionCompanyLabel;
    private com.toedter.calendar.JDateChooser releaseDateDateChooser;
    private javax.swing.JLabel releaseDateLabel;
    private javax.swing.JButton removeArtistButton;
    private javax.swing.JButton removeGroupButton;
    private javax.swing.JButton saveButton;
    private java.util.List<pojos.Song> songList;
    private javax.swing.JPanel songListPanel;
    private javax.persistence.Query songQuery;
    private javax.swing.JTable songTable;
    private javax.swing.JLabel titleLabel;
    private javax.swing.JTextField titleTextField;
    private javax.swing.JComboBox typeComboBox;
    private javax.swing.JLabel typeLabel;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables
}
